/*
 * SEGUNDA ENTREGA DEL PROYECTO DE BASES DE DATOS "BIBLIOTECA DIGITAL"
 * 
 * Integrantes:
 * Gamboa Edwin Ricardo Cód: 0926631 plan: 2711
 * Portilla Cortes Maria Cristina Cód: 0844113 plan: 3743 
 * Rosero Rosero Luis Alberto Cód: 0943740 plan:3743
 * 
 */
package gui;

import logica.Usuario;
import controlador.*;
import java.awt.event.ItemEvent;
import javax.swing.JOptionPane;
import java.awt.*;
import java.util.Calendar;
import java.util.GregorianCalendar;


/*
 * BocetoAgregarUsuario.java
 *
 * Created on Apr 25, 2011, 6:29:24 PM
 */

/**
 *
 * @author CRISTINA
 */
public class GUIAgregarUsuario extends javax.swing.JFrame {
   String fechaNacimiento="",dia="",mes="",ano="",genero="",nivelEscolaridad="",
           vinculo_UV="",contrasena="",contrasenaVerificacion,tipo_usuario="",fechaDeRegistro="";
   boolean contrasenaCorrecta=false;
   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
   AddAreasUsuario dialogoAgregarAreas;
   private ControladorUsuario control=new ControladorUsuario();

    /** Creates new form BocetoAgregarUsuario */
    public GUIAgregarUsuario() {
        initComponents();
        setLocation((screenSize.width-494)/2,(screenSize.height-272)/2);
        setVisible(true);         
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        Botonlimpiarcampos = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        BotonIngresarUsuario = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        campoNombres = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        campoApellidos = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        comboboxGenero = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        ComboBoxDiaNacimiento = new javax.swing.JComboBox();
        ComoboBoxMesNacimiento = new javax.swing.JComboBox();
        ComboBoxAnoNacimiento = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        campoEmail = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        ComboBoxEscolaridad = new javax.swing.JComboBox();
        jPanel2 = new javax.swing.JPanel();
        EtiquetaLogin = new javax.swing.JLabel();
        Campologin = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        camporespuestaSecreta = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        etiquetaCodigo = new javax.swing.JLabel();
        CampoCodigo = new javax.swing.JTextField();
        campoPassword = new javax.swing.JPasswordField();
        campoVerificacioDePassword = new javax.swing.JPasswordField();
        jLabel1 = new javax.swing.JLabel();
        comoboboxVinculoUV = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        comboboxtipoUsuario = new javax.swing.JComboBox();
        ComboBoxPSecreta = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Registrar un nuevo usuario");
        setBackground(new java.awt.Color(255, 255, 255));
        setResizable(false);

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));

        Botonlimpiarcampos.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        Botonlimpiarcampos.setForeground(new java.awt.Color(255, 0, 0));
        Botonlimpiarcampos.setText("Limpiar Campos");
        Botonlimpiarcampos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonlimpiarcamposActionPerformed(evt);
            }
        });

        jButton1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jButton1.setForeground(new java.awt.Color(255, 0, 0));
        jButton1.setText("Agregar Areas de Interes");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        BotonIngresarUsuario.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        BotonIngresarUsuario.setForeground(new java.awt.Color(255, 0, 0));
        BotonIngresarUsuario.setText("Ingresar Usuario");
        BotonIngresarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonIngresarUsuarioActionPerformed(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Personales", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 12), new java.awt.Color(255, 51, 0))); // NOI18N

        jLabel2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(153, 153, 153));
        jLabel2.setText("Nombres");

        campoNombres.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        campoNombres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoNombresActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(153, 153, 153));
        jLabel3.setText("Apellidos");

        campoApellidos.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        campoApellidos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoApellidosActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(153, 153, 153));
        jLabel4.setText("Genero");

        comboboxGenero.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        comboboxGenero.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "elija una opcion", "femenino", "masculino" }));
        comboboxGenero.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                comboboxGeneroItemStateChanged(evt);
            }
        });
        comboboxGenero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboboxGeneroActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel5.setForeground(new java.awt.Color(153, 153, 153));
        jLabel5.setText("Fecha de Nacimiento");

        ComboBoxDiaNacimiento.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        ComboBoxDiaNacimiento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "dia", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
        ComboBoxDiaNacimiento.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                ComboBoxDiaNacimientoItemStateChanged(evt);
            }
        });
        ComboBoxDiaNacimiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComboBoxDiaNacimientoActionPerformed(evt);
            }
        });

        ComoboBoxMesNacimiento.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        ComoboBoxMesNacimiento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "mes", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));
        ComoboBoxMesNacimiento.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                ComoboBoxMesNacimientoItemStateChanged(evt);
            }
        });
        ComoboBoxMesNacimiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComoboBoxMesNacimientoActionPerformed(evt);
            }
        });

        ComboBoxAnoNacimiento.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        ComboBoxAnoNacimiento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "anio", "1980", "1981", "1982", "1983", "1984", "1985", "1986", "1986", "1987", "1988", "1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998" }));
        ComboBoxAnoNacimiento.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                ComboBoxAnoNacimientoItemStateChanged(evt);
            }
        });
        ComboBoxAnoNacimiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComboBoxAnoNacimientoActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(153, 153, 153));
        jLabel6.setText("e-mail");

        campoEmail.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        campoEmail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoEmailActionPerformed(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(153, 153, 153));
        jLabel7.setText("nivel de escolaridad");

        ComboBoxEscolaridad.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        ComboBoxEscolaridad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "elija una opcion", "preescolar", "basica primaria", "secundaria", "universitario" }));
        ComboBoxEscolaridad.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                ComboBoxEscolaridadItemStateChanged(evt);
            }
        });
        ComboBoxEscolaridad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComboBoxEscolaridadActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(campoEmail, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addComponent(ComboBoxDiaNacimiento, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(ComoboBoxMesNacimiento, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(ComboBoxAnoNacimiento, 0, 117, Short.MAX_VALUE))
                    .addComponent(ComboBoxEscolaridad, 0, 383, Short.MAX_VALUE)
                    .addComponent(comboboxGenero, 0, 383, Short.MAX_VALUE)
                    .addComponent(campoApellidos, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
                    .addComponent(campoNombres, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(campoNombres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoApellidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboboxGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(ComboBoxEscolaridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(ComboBoxDiaNacimiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ComoboBoxMesNacimiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ComboBoxAnoNacimiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Informacion de Usuario", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 14), new java.awt.Color(255, 0, 0))); // NOI18N

        EtiquetaLogin.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        EtiquetaLogin.setForeground(new java.awt.Color(153, 153, 153));
        EtiquetaLogin.setText("Login");

        Campologin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CampologinActionPerformed(evt);
            }
        });

        jLabel10.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(153, 153, 153));
        jLabel10.setText("password");

        jLabel11.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(153, 153, 153));
        jLabel11.setText("verificacion");

        camporespuestaSecreta.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        camporespuestaSecreta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camporespuestaSecretaActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel12.setForeground(new java.awt.Color(153, 153, 153));
        jLabel12.setText("Pregunta secreta:");

        jLabel13.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel13.setForeground(new java.awt.Color(153, 153, 153));
        jLabel13.setText("Respuesta Secreta");

        etiquetaCodigo.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        etiquetaCodigo.setForeground(new java.awt.Color(153, 153, 153));
        etiquetaCodigo.setText("Codigo");

        CampoCodigo.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        CampoCodigo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CampoCodigoActionPerformed(evt);
            }
        });

        campoPassword.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        campoPassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoPasswordActionPerformed(evt);
            }
        });

        campoVerificacioDePassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoVerificacioDePasswordActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(153, 153, 153));
        jLabel1.setText("Vinculo Univalle");

        comoboboxVinculoUV.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        comoboboxVinculoUV.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "elija una opcion", "estudiante", "profesor", "trabajador", "pensionado" }));
        comoboboxVinculoUV.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                comoboboxVinculoUVItemStateChanged(evt);
            }
        });
        comoboboxVinculoUV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comoboboxVinculoUVActionPerformed(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(153, 153, 153));
        jLabel8.setText("tipo de usuario");

        comboboxtipoUsuario.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        comboboxtipoUsuario.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "elija una opcion", "Administrador", "Catalogador", "Usuario Registrado" }));
        comboboxtipoUsuario.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                comboboxtipoUsuarioItemStateChanged(evt);
            }
        });
        comboboxtipoUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboboxtipoUsuarioActionPerformed(evt);
            }
        });

        ComboBoxPSecreta.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N
        ComboBoxPSecreta.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "cual es el nombre de tu primera mascota?", "cual es el nombre de el profesor que mas te gusta?", "cual es el primer nombre de tu mejor amigo?" }));
        ComboBoxPSecreta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComboBoxPSecretaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                .addComponent(comoboboxVinculoUV, 0, 151, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(comboboxtipoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(camporespuestaSecreta, javax.swing.GroupLayout.DEFAULT_SIZE, 517, Short.MAX_VALUE)
                            .addComponent(ComboBoxPSecreta, 0, 517, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(etiquetaCodigo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(CampoCodigo)
                            .addComponent(campoPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(EtiquetaLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(24, 24, 24))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(Campologin)
                            .addComponent(campoVerificacioDePassword, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(CampoCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(etiquetaCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(EtiquetaLogin))
                    .addComponent(Campologin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(campoPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(campoVerificacioDePassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel11))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(ComboBoxPSecreta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel13))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55, Short.MAX_VALUE)
                        .addComponent(camporespuestaSecreta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(comoboboxVinculoUV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(comboboxtipoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BotonIngresarUsuario, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE)
                    .addComponent(Botonlimpiarcampos, javax.swing.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BotonIngresarUsuario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Botonlimpiarcampos)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ComboBoxDiaNacimientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComboBoxDiaNacimientoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ComboBoxDiaNacimientoActionPerformed

    private void campoNombresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoNombresActionPerformed
        
    }//GEN-LAST:event_campoNombresActionPerformed

    private void comboboxGeneroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboboxGeneroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboboxGeneroActionPerformed

    private void ComoboBoxMesNacimientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComoboBoxMesNacimientoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ComoboBoxMesNacimientoActionPerformed

    private void camporespuestaSecretaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camporespuestaSecretaActionPerformed
         
    }//GEN-LAST:event_camporespuestaSecretaActionPerformed

    private void BotonIngresarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonIngresarUsuarioActionPerformed
       
       Calendar c1 = Calendar.getInstance();
       Calendar calendario = new GregorianCalendar();
       
       
       
       fechaDeRegistro=Integer.toString(calendario.get(Calendar.YEAR))+"-"+Integer.toString(calendario.get(Calendar.MONTH))+"-"+Integer.toString(calendario.get(Calendar.DATE));
       System.out.println(fechaDeRegistro);
       
       boolean completo = true;        
        String mensaje = "Hay errores en el registro del Usuario:     " + "\n\n";
        if(CampoCodigo.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Codigo está vacío." + "\n";
        }
        if(completo && control.existeCodigo(CampoCodigo.getText())){
            completo = false;
            mensaje += "-> El Codigo ingresado ya existe." + "\n";
        }
        if(Campologin.getText().equals("")){
            completo = false;
            mensaje += "-> El campo login está vacío." + "\n";
        }
        if(completo && control.existeLogin(Campologin.getText())){
            completo = false;
            mensaje += "-> El Codigo ingresado ya existe." + "\n";
        }
        if(campoNombres.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Nombres está vacío." + "\n";
        }
        if(campoApellidos.getText().equals("")){
            completo = false;
            mensaje += "-> El campo Apellidos está vacío." + "\n";
        }
        if(campoEmail.getText().equals("")){
            completo = false;
            mensaje += "-> El campo e-mail está vacío." + "\n";
        }
        if(campoPassword.getText().equals("")){
            completo = false;
            mensaje += "-> El campo contrasena está vacío." + "\n";
        }
        
        if(camporespuestaSecreta.getText().equals("")){
            completo = false;
            mensaje += "-> El campo contrasena está vacío." + "\n";
        }
        if(campoPassword.getPassword().equals("")){
            completo = false;
            mensaje += "-> El campo contrasena está vacío." + "\n";
        }
        if(campoPassword.getPassword().equals("")){
            completo = false;
            mensaje += "-> El campo contrasena está vacío." + "\n";
        }
        
        if(dia.equals("dia")){
            completo = false; 
            mensaje += "-> Debe elegir un Dia para la Fecha de Nacimiento." + "\n";
        }
        if(mes.equals("mes")){
            completo = false;
            mensaje += "-> Debe elegir un Mes para la Fecha de Nacimiento." + "\n";
        }
        if(ano.equals("anio")){
            completo = false;
            mensaje += "-> Debe elegir un Anio para la Fecha de Nacimiento." + "\n";
        }
        if(vinculo_UV.equals("elija una opcion")){
            completo = false;
            mensaje += "-> Debe elegir el Vinculo Univalle." + "\n";
        }
        if(tipo_usuario.equals("elija una opcion")){
            completo = false;
            mensaje += "-> Debe elegir el Tipo de Usuario." + "\n";
        }
        if(genero.equals("elija una opcion")){
            completo = false;
            mensaje += "-> Debe elegir el Genero." + "\n";
        }
        if(genero.equals("elija una opcion")){
            completo = false;
            mensaje += "-> Debe elegir el Genero." + "\n";
        }
        
        if(completo){
            control.registrarUsario(CampoCodigo.getText(),
                               campoNombres.getText(),
                               campoApellidos.getText(),
                               genero,
                               ano+"-"+mes+"-"+dia,
                               campoEmail.getText(),
                               nivelEscolaridad,
                               vinculo_UV,
                               ComboBoxPSecreta.getSelectedItem().toString(),
                               camporespuestaSecreta.getText(),
                               Campologin.getText(),
                               contrasena = campoPassword.getText(),
                               tipo_usuario,
                               fechaDeRegistro,
                               "0"
                               );
            
                       
            Usuario info = control.retornarUsuarioPorCodigo2(CampoCodigo.getText());
                                    
            JOptionPane.showMessageDialog(this, "El Usuario fue registrado con "
                    + "éxito y con la siguiente informacion:"+ 
                    "\n\nCodigo: "+ info.getCodigo() +
                    "\nNombres: "+ info.getNombre()+
                    "\nApellidos: "+ info.getApellido()+
                    "\nGenero: "+ info.getgenero()+
                    "\nFecha de Nacimiento: "+ info.getFechaDeNacimiento()+
                    "\nE-Mail: "+ info.getCorreoElectrónico()+
                    "\nNivel de Escolaridad: "+ info.getNivelEscolaridad()+
                    "\nLogin: "+ info.getLogin()+"\n","Usuario registrado con exito",JOptionPane.INFORMATION_MESSAGE);  
                              
            
            
        } 
        else{
            JOptionPane.showMessageDialog(this, mensaje, "Error de registro",
                    JOptionPane.ERROR_MESSAGE);
        }
      
    }//GEN-LAST:event_BotonIngresarUsuarioActionPerformed

    private void CampologinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CampologinActionPerformed
      
    }//GEN-LAST:event_CampologinActionPerformed

    private void CampoCodigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CampoCodigoActionPerformed
      
    }//GEN-LAST:event_CampoCodigoActionPerformed

    private void campoPasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoPasswordActionPerformed
        contrasena=new String(campoPassword.getPassword());
        
    }//GEN-LAST:event_campoPasswordActionPerformed

    private void campoVerificacioDePasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoVerificacioDePasswordActionPerformed
        contrasenaVerificacion=new String(campoPassword.getPassword());
       
        if(contrasena.equals(contrasenaVerificacion)){
            contrasenaCorrecta=true;          
        }
        else{
             JOptionPane.showMessageDialog(null,"escriba de nuevo la contrasena","Verifiacion de contrasena Incorrecta",JOptionPane.ERROR_MESSAGE);
           }

    }//GEN-LAST:event_campoVerificacioDePasswordActionPerformed

    private void campoApellidosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoApellidosActionPerformed
        
    }//GEN-LAST:event_campoApellidosActionPerformed

    private void comboboxGeneroItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comboboxGeneroItemStateChanged
        String[] index={"","f","m"};
        if(evt.getStateChange()==ItemEvent.SELECTED){
            genero=index[comboboxGenero.getSelectedIndex()];
        } 
    }//GEN-LAST:event_comboboxGeneroItemStateChanged

    private void campoEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoEmailActionPerformed
       
    }//GEN-LAST:event_campoEmailActionPerformed

    private void ComboBoxAnoNacimientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComboBoxAnoNacimientoActionPerformed
        


    }//GEN-LAST:event_ComboBoxAnoNacimientoActionPerformed

    private void ComboBoxDiaNacimientoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ComboBoxDiaNacimientoItemStateChanged
            if(evt.getStateChange()==ItemEvent.SELECTED){
                dia=Integer.toString(ComboBoxDiaNacimiento.getSelectedIndex()); 
        }

    }//GEN-LAST:event_ComboBoxDiaNacimientoItemStateChanged

    private void ComoboBoxMesNacimientoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ComoboBoxMesNacimientoItemStateChanged
        if(evt.getStateChange()==ItemEvent.SELECTED){
            mes=Integer.toString(ComoboBoxMesNacimiento.getSelectedIndex());
            System.out.println(ComoboBoxMesNacimiento.getSelectedIndex());
        }
    }//GEN-LAST:event_ComoboBoxMesNacimientoItemStateChanged

    private void ComboBoxAnoNacimientoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ComboBoxAnoNacimientoItemStateChanged
        String[] anos={"Anio:","1980","1981","1982","1983","1984","1985","1986","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998"};
        if(evt.getStateChange()==ItemEvent.SELECTED){
            ano=anos[ComboBoxAnoNacimiento.getSelectedIndex()];
        } 
    }//GEN-LAST:event_ComboBoxAnoNacimientoItemStateChanged

    private void ComboBoxEscolaridadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComboBoxEscolaridadActionPerformed
        
        
            
    }//GEN-LAST:event_ComboBoxEscolaridadActionPerformed

    private void ComboBoxEscolaridadItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ComboBoxEscolaridadItemStateChanged
        String[] niveles={"Ninguno:","preescolar","basica primaria","secundaria","universitario"};
        if(evt.getStateChange()==ItemEvent.SELECTED){ 
            nivelEscolaridad=niveles[ComboBoxEscolaridad.getSelectedIndex()]; 
        }
    }//GEN-LAST:event_ComboBoxEscolaridadItemStateChanged

    private void comoboboxVinculoUVItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comoboboxVinculoUVItemStateChanged
        String vinculo[]={"ninguno:","estudiante","profesor","trabajador","pensionado"};
        if(evt.getStateChange()==ItemEvent.SELECTED){
            vinculo_UV=vinculo[comoboboxVinculoUV.getSelectedIndex()];
        }
           
    }//GEN-LAST:event_comoboboxVinculoUVItemStateChanged

        private void comboboxtipoUsuarioItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_comboboxtipoUsuarioItemStateChanged
            if(evt.getStateChange()==ItemEvent.SELECTED){
                tipo_usuario=Integer.toString(comboboxtipoUsuario.getSelectedIndex());
                 
            }

               

        }//GEN-LAST:event_comboboxtipoUsuarioItemStateChanged

        private void comoboboxVinculoUVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comoboboxVinculoUVActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_comoboboxVinculoUVActionPerformed

        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
            dialogoAgregarAreas=new AddAreasUsuario(CampoCodigo.getText());
            dialogoAgregarAreas.setVisible(true);
            
        
        
        }//GEN-LAST:event_jButton1ActionPerformed

        private void comboboxtipoUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboboxtipoUsuarioActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_comboboxtipoUsuarioActionPerformed

        private void ComboBoxPSecretaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComboBoxPSecretaActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_ComboBoxPSecretaActionPerformed

        private void BotonlimpiarcamposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonlimpiarcamposActionPerformed
            CampoCodigo.setText("");
            campoNombres.setText("");
            campoApellidos.setText("");
            campoPassword.setText("");
            campoVerificacioDePassword.setText("");
            comboboxGenero.setSelectedIndex(0);
            ComboBoxDiaNacimiento.setSelectedIndex(0);
            ComoboBoxMesNacimiento.setSelectedIndex(0);
            ComboBoxAnoNacimiento.setSelectedIndex(0);
            ComboBoxEscolaridad.setSelectedIndex(0);
            comoboboxVinculoUV.setSelectedIndex(0);
            comboboxtipoUsuario.setSelectedIndex(0);
            campoEmail.setText("");
            ComboBoxPSecreta.setSelectedIndex(0);
            camporespuestaSecreta.setText("");
            Campologin.setText("");
            campoPassword.setText("");
        }//GEN-LAST:event_BotonlimpiarcamposActionPerformed

    /**
    * @param args the command line arguments
    */
    /*public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new GUIAgregarUsuario();
                
            }
        });

    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonIngresarUsuario;
    private javax.swing.JButton Botonlimpiarcampos;
    private javax.swing.JTextField CampoCodigo;
    private javax.swing.JTextField Campologin;
    private javax.swing.JComboBox ComboBoxAnoNacimiento;
    private javax.swing.JComboBox ComboBoxDiaNacimiento;
    private javax.swing.JComboBox ComboBoxEscolaridad;
    private javax.swing.JComboBox ComboBoxPSecreta;
    private javax.swing.JComboBox ComoboBoxMesNacimiento;
    private javax.swing.JLabel EtiquetaLogin;
    private javax.swing.JTextField campoApellidos;
    private javax.swing.JTextField campoEmail;
    private javax.swing.JTextField campoNombres;
    private javax.swing.JPasswordField campoPassword;
    private javax.swing.JPasswordField campoVerificacioDePassword;
    private javax.swing.JTextField camporespuestaSecreta;
    private javax.swing.JComboBox comboboxGenero;
    private javax.swing.JComboBox comboboxtipoUsuario;
    private javax.swing.JComboBox comoboboxVinculoUV;
    private javax.swing.JLabel etiquetaCodigo;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    // End of variables declaration//GEN-END:variables

}
